import axios from '@/utils/request'

/* 获取用户的channel */
export const getUserChannel = () =>
  axios({
    url: '/v1_0/user/channels'
  })

/**
 * 获取所有的频道信息
 */
export const getAllChannel = () => {
  return axios({
    method: 'get',
    url: '/v1_0/channels'
  })
}
// 设置用户频道
export function setUserChannels(channels) {
  return axios({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels
    }
  })
}
// 删除频道，提供接口
export function delUserChannels(target) {
  return axios({
    method: 'DELETE',
    // target  需要删除的用户频道id
    url: '/v1_0/user/channels/' + target
  })
}
